package com.lc.cehui.ui.fragment;

import android.widget.TextView;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.lc.cehui.R;
import com.lc.cehui.app.AppFragment;
import com.lc.cehui.http.response.CompanyMeetShowBean;
import com.lc.cehui.other.IntentKey;
import com.lc.cehui.ui.activity.home.ExhibitionDetailsActivity;
import com.lc.cehui.util.CourseUtils;
import com.lc.cehui.util.SPUtil;

import butterknife.BindView;

public class ExhibitionInformationFragment extends AppFragment<ExhibitionDetailsActivity> {
    @BindView(R.id.tv_name)
    TextView tvName;
    @BindView(R.id.tv_mianji)
    TextView tvMianji;
    @BindView(R.id.tv_tel)
    TextView tvTel;
    @BindView(R.id.tv_address)
    TextView tvAddress;

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_exhibitioninformation;
    }

    @Override
    protected void initView() {

    }

    @Override
    protected void initData() {
        Gson gson = new Gson();
//                将存储的数据转成实体类
        CompanyMeetShowBean  data = gson.fromJson(SPUtil.get(getContext(), IntentKey.TEXT,""), new TypeToken<CompanyMeetShowBean>() {
        }.getType());
        tvName.setText("展会名称      "+data.getData().getExhibition_name());
        tvMianji.setText("展馆面积     "+data.getData().getExhibition_area()+"平方米");
        tvTel.setText("联系电话      "+ data.getData().getExhibition_tel());
        tvAddress.setText("联系电话      "+ data.getData().getExhibition_city()+data.getData().getExhibition_company());
    }
}
